package com.yx.changdao.generate.model;

import com.yx.changdao.generate.utils.CodeGenerateUtils;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @Description: <br/>
 * 生成代码参数的实体
 * <p>
 * <br/>
 * @Auther: zhangqi
 * @create 2019/11/25 13:56
 */
public class CreateCodeParam {

    /**
     * 时间
     */
    public static String CURRENT_DATE = new SimpleDateFormat("yyyy/MM/dd HH:mm").format(new Date());

    /**
     * 作者
     */
    public static String AUTHOR;

    /**
     * 包名 格式 com.公司名.项目名
     */
    public static String PACKAGE_NAME;

    /**
     * 数据库连接的地址
     */
    public static String URL;

    /**
     * 用户名
     */
    public static String USER;

    /**
     * 密码
     */
    public static String PASSWORD;


    /**
     * 表名
     */
    public static String TABLE_NAME;

    public void setAuthor(String author) {
        CreateCodeParam.AUTHOR = author;
    }


    public void setPackageName(String packageName) {
        CreateCodeParam.PACKAGE_NAME = packageName;
    }

    public void setURL(String url) {
        CreateCodeParam.URL = CodeGenerateUtils.createDBLink(url);
    }

    public void setUser(String user) {
        CreateCodeParam.USER = user;
    }

    public void setPassword(String password) {
        CreateCodeParam.PASSWORD = password;
    }

    public void setTableName(String tableName) {
        CreateCodeParam.TABLE_NAME = tableName;
    }
}
